Use Tex-Edit’s extensive dictionary of AppleScript terms to easily automate complex actions. The dictionary lists all terms understood by Tex-Edit as well as the syntax of their use. The terms are grouped into the Standard, Text, and Tex-Edit Suites. The Standard Suite should be the same in most programs. The Text Suite contains a description of the terms used to refer to text objects. The Tex-Edit Suite contains terms that implement special Tex-Edit features.
This dictionary can also be accessed via the Script Editor program (“Open Dictionary”). Print a copy of this document and keep it as a handy reference for creating or modifying scripts.
Standard Suite Subset: Common terms for most applications
open: Open the specified file(s)
open reference -- the file to open
Result: reference -- a reference to the newly created document window
run: Run an application
run
reopen: Reactivate a running application
reopen
print: Print the specified document(s)
print reference -- the file(s) or window(s) to print
quit: Quit the application
quit
[saving yes/no/ask] -- specifies whether to save changes before quitting
close: Close the specified window(s)
close reference -- the window(s) to close
[saving yes/no/ask] -- specifies whether changes should be saved before closing
[saving in file specification] -- the file in which to save the window
count: Return the number of elements of a particular class within an object
count reference -- the object whose elements are to be counted
[each type class] -- the class of the elements to be counted
Result: integer -- the number of elements
delete: Delete the specified object(s)
delete reference -- the object(s) to delete
duplicate: Duplicate an object
duplicate reference -- the object to duplicate
[to location reference] -- the new location for the object
Result: reference -- a reference to the duplicated object
exists: Verify if an object exists
exists reference -- the object in question
Result: boolean -- true if it exists, false if not
make: Create a new object
make
new type class -- the class of the object to be created
[at location reference] -- the location at which to insert the object
[with data anything] -- the initial data contained by the object
[with properties record] -- the initial values for the properties of the object
Result: reference -- a reference to the newly created object
move: Move an object to a new location
move reference -- the object to move
to location reference -- the new location for the object
Result: reference -- a reference to the moved object
save: Save the specified window(s) to disk
save reference -- the window(s) to save
[in file specification] -- the file in which to save the window
[as type class] -- the file type of the document in which to save the data
[with creator type class] -- the creator type of the document in which to save the data
[stationery pad creation boolean] -- saving the file as a stationery pad document?
[unstyled formatting boolean] -- saving the file as plain unstyled text?
select: Make a selection
select reference -- the object to select
data size: Return the size (in bytes) of an object
data size reference -- the object whose data size is to be returned
[as type class] -- the data type for which the size is calculated
Result: integer -- the size of the object in bytes
get: Get the value of (or a reference to) the specified object(s)
get reference -- the object(s) whose data is to be returned
[as type class] -- the preferred type for the returned data
Result: anything -- the data from the object
set: Set the property or data of the object(s)
set reference -- the object(s) to set
to anything -- the new value for the object
Class application: An application program
Elements:
window by numeric index, by name, before/after another element, satisfying a test, as a range of elements
document by numeric index, by name, before/after another element, satisfying a test, as a range of elements
Properties:
name international text [r/o] -- the name of the application
frontmost boolean [r/o] -- is this the active (frontmost) application?
selection selection-object -- the text selection of the frontmost window
clipboard a list of anything [r/o] -- contents of the clipboard for this application
version version [r/o] -- the version number of the application
Class window: A document window
Plural form:
windows
Properties:
name international text -- the title of the window
index integer -- the number of the window (ordered front to back)
bounds bounding rectangle -- the bounding rectangle for the window
position point -- the coordinates of the top-left corner of the window
contents anything -- the textual contents of the window
selection selection-object -- the text selected in the window
closeable boolean [r/o] -- does the window have a close box?
floating boolean [r/o] -- does the window float?
modal boolean [r/o] -- is the window modal?
resizable boolean [r/o] -- is the window resizable?
titled boolean [r/o] -- does the window have a title bar?
visible boolean [r/o] -- is the window visible?
collapsible boolean [r/o] -- is the window collapsible (OS 8)?
zoomable boolean [r/o] -- is the window zoomable?
collapsed boolean -- is the window collapsed (OS 8)?
zoomed boolean -- is the window zoomed?
modified boolean [r/o] -- have the window contents been changed since the last save?
Class document: A document window (same as ‘window’)
Plural form:
documents
Class file: A file on disk
Plural form:
files
Class selection-object: The textual selection visible to the user
Properties:
contents international text -- the textual contents of the selection. Use the ‘select’ command to make a new selection. Use ‘contents of selection’ to get or change text in a window.
Text Suite Subset: A set of classes for text processing
Class text: Text
Elements:
insertion point by numeric index, before/after another element, satisfying a test, as a range of elements
character by numeric index, before/after another element, satisfying a test, as a range of elements
word by numeric index, before/after another element, satisfying a test, as a range of elements
line by numeric index, before/after another element, satisfying a test, as a range of elements
paragraph by numeric index, before/after another element, satisfying a test, as a range of elements
style run by numeric index, before/after another element, satisfying a test, as a range of elements
sound by numeric index, before/after another element, satisfying a test, as a range of elements
picture by numeric index, before/after another element, satisfying a test, as a range of elements
movie by numeric index, before/after another element, satisfying a test, as a range of elements
model by numeric index, before/after another element, satisfying a test, as a range of elements
Properties:
font text -- the name of the font
size integer -- the font size in points
color black/red/green/blue/cyan/magenta/yellow/white/marble/gray/sky/
ocean/rose/tan/lemon -- the color of the text (or use RGB color)
hilite color none/black/red/green/blue/cyan/magenta/yellow/white/marble/gray/sky/
ocean/rose/tan/lemon -- the color of the hiliting behind the text (or use RGB color)
style text style info -- the text style
baseline ascent integer -- the vertical offset, in points, of the superscript (negative for subscript)
justification left/center/right/full/default -- justification of the text
left indent integer -- the space (in points) between the left page margin and the paragraph
right indent integer -- the space (in points) between the right page margin and the paragraph
first indent integer -- the first line indent (in points) of the paragraph (negative for outdent)
space above integer -- the space (in points) preceding the paragraph
space below integer -- the space (in points) following the paragraph
line spacing fixed -- the extra space between lines (0.0 is normal, 1.0 is double)
bottom border none/thin line/dotted line/thick line -- the border line following the paragraph
text direction left to right/right to left/default -- the primary direction of the text
uniform styles text style info [r/o] -- the styles uniformly on or off throughout the text
capitalization uppercase/lowercase/word caps/sentence caps -- the case
offset integer [r/o] -- the offset from the beginning of the document, in characters
word offset integer [r/o] -- the word number in which the specified text item resides
line offset integer [r/o] -- the line number on which the specified text item resides
paragraph offset integer [r/o] -- the paragraph number in which the specified text item resides
length integer [r/o] -- length of the text object, in characters
best type type class [r/o] -- the best descriptor type
default type type class [r/o] -- the default descriptor type
class type class [r/o] -- the class of the object
writing code 'intl' [r/o] -- the script system and language
Class insertion point: An insertion location between two characters
Plural form:
insertion points
Properties:
<Inheritance> text [r/o] -- all properties of the text class are inherited by this class
Class character: A character
Plural form:
characters
Properties:
<Inheritance> text [r/o] -- all properties of the text class are inherited by this class
Class word: A word
Plural form:
words
Properties:
<Inheritance> text [r/o] -- all properties of the text class are inherited by this class
Class line: A line
Plural form:
lines
Properties:
<Inheritance> text [r/o] -- all properties of the text class are inherited by this class
Class paragraph: A paragraph
Plural form:
paragraphs
Properties:
<Inheritance> text [r/o] -- all properties of the text class are inherited by this class
Class style run: A range of text whose style attributes are identical
Plural form:
style runs
Properties:
<Inheritance> text [r/o] -- all properties of the text class are inherited by this class
Class text style info: The on and off styles of a text object
Properties:
on styles a list of plain/bold/italic/underline/outline/shadow/condensed/expanded/strikethrough [r/o]
off styles a list of plain/bold/italic/underline/outline/shadow/condensed/expanded/strikethrough [r/o]
Tex-Edit Suite: Various terms supported by Tex-Edit
search: Search for the occurrence of a given string
search reference -- the object to search
[looking for international text] -- the string to search for
[finding next/previous] -- finding next or previous occurrence of search string?
[cases matching boolean] -- must capitalization match?
[whole words matching boolean] -- match whole words only?
[searching from cursor boolean] -- start searching from current cursor position?
[global searching boolean] -- search all open windows?
[looking for styles record] -- the text styles that must be matched
Result: boolean -- true if a match was found
replace: Replace all occurrences of a given string with another string
replace reference -- the object to search
[looking for international text] -- the string to search for
[replacing with international text] -- the string to replace the found string
[cases matching boolean] -- must capitalization match?
[whole words matching boolean] -- match whole words only?
[global replacing boolean] -- make replacements in all open windows?
[looking for styles record] -- the text styles that must be present in the found string
[replacing with styles record] -- the text styles of the replacement string
[replacing tabs with spaces integer] -- replace each tab with this many spaces (0-99)
[replacing multiple spaces with single space/single tab/cr/nothing] -- replace each run of spaces
Result: integer -- the number of replacements made
add line endings: Add commonly used line ending characters
add line endings reference -- the object to be modified
appending cr/crlf -- the terminating characters to be added
[with line length integer] -- maximum line length after adding endings (20-200)
strip line endings: Remove commonly used line ending characters
strip line endings reference -- the object to be modified
removing cr/crlf -- the terminating characters to be removed
[with line length integer] -- minimum length line to be stripped of endings (0-80)
strip: Remove various characters from the text
strip reference -- the object to be modified
removing low ascii/high ascii/double spaces/leading spaces/trailing spaces/diacriticals -- the characters to be removed
smarten: Transform plain characters into typographical characters
smarten reference -- the object to be modified
converting quotes/ligatures/ellipses/dashes -- the characters to transform
stupefy: Transform typographical characters into plain characters
stupefy reference -- the object to be modified
converting quotes/ligatures/ellipses/dashes -- the characters to transform
balance: Extend the text selection to balance parentheses, brackets, and braces
balance reference -- the text object whose opening/closing parentheses will be matched
Result: boolean -- true if the text was successfully balanced
block format: Block off (indent) the specified text for emphasis
block format reference -- the text object to be blocked
[with line header international text] -- the string to precede each line (1-15 chars)
[with line length integer] -- maximum line length (20-200)
[with leading line international text] -- the line of text that will precede the block
[with trailing line international text] -- the line of text that will follow the block
shift: Indent/outdent the specified text by adding/removing leading tabs
shift reference -- the text object that will be indented/outdented
toward left/right -- the direction to shift the specified text
sort: Sorts the selected paragraphs
sort reference -- the text object whose paragraphs will be sorted
[reverse sorting boolean] -- sorting in reverse (descending) order?
[cases ignored boolean] -- is capitalization ignored during (Roman) sorting?
[diacriticals ignored boolean] -- are diacritical markings ignored during (Roman) sorting?
change case: Change the case of the specified text
change case reference -- the text object whose case will be changed
into uppercase/lowercase/word caps/sentence caps -- the desired case of the specified text
change size: Increment/decrement the size(s) of the specified text
change size reference -- the text object whose point size(s) will be changed
increasing by integer -- the amount to increment the size (negative number decrements)
do script: Perform the actions specified in the script
do script reference -- the script to execute (specify text or file)
revert: Discard the changes made to a window since it was last saved
revert reference -- the window to revert
undo: Reverse the most recent undoable action
undo
redo: Reverse the action of the most recent undo
redo
cut: Copy the selection to the clipboard, then remove it
cut
copy: Copy the selection to the clipboard
copy
copy unstyled: Copy the selection to the clipboard, ignoring styles
copy unstyled
paste: Paste the contents of the clipboard into the selection
paste
paste unstyled: Paste the contents of the clipboard into the selection, ignoring styles
paste unstyled
paste style: Apply the style of the clipboard contents to the selection
paste style
print one copy: Print the specified document(s) avoiding the print job dialog
print one copy reference -- the file(s) or window(s) to print
print selection: Print the selected text in the specified window(s)
print selection reference -- the window(s) to print
insert date: Insert the current date
insert date
[at location reference] -- the new location for the date
insert time: Insert the current time
insert time
[at location reference] -- the new location for the time
insert page break: Insert a hard page break, generating a new page during printout
insert page break
[at location reference] -- the new location for the page break
insert contents: Insert the contents of the given file
insert contents
of file specification -- the file whose contents will be inserted
[at location reference] -- the new location for the inserted material
insert sounds: Inserts all sounds from a given file
insert sounds
of file specification -- the file whose sounds will be inserted
[at location reference] -- the new location for the sounds
playback: Play the specified sound or movie
playback reference -- the sound or movie to play
speak: Read the given object aloud
speak reference -- the object to be read
Class application: The Tex-Edit application program
Properties:
search string international text -- the string to search for
replace string international text -- the string to replace it with
auto indent boolean -- is automatic indenting on?
shift delete boolean -- does shift-delete mimic the forward delete key?
smart editing boolean -- is inter-word spacing maintained during cut/copy/paste?
smart quotes boolean -- using smart (curly) quotes during text entry?
leading single quote character -- leading (curly) single quote character
trailing single quote character -- trailing (curly) single quote character
plain single quote character -- plain (straight) single quote character
leading double quote character -- leading (curly) double quote character
trailing double quote character -- trailing (curly) double quote character
plain double quote character -- plain (straight) double quote character
block leading line international text -- line of text that precedes block-formatted text
block trailing line international text -- line of text that follows block-formatted text
block line header international text -- characters (0-15) that precede each line in blocked text
block line length integer -- maximum number of characters on each line of blocked text (20-200)
block words split boolean -- are words split when block formatting (Japanese)?
tab makes spaces boolean -- is each tab converted to spaces during text entry?
spaces per tab integer -- spaces entered in place of a tab (1-99)
default real tabs boolean -- are real tabs on by default?
tab width integer -- points between tab stops (1-256)
default creator type class -- default creator type used when saving documents
default creator used boolean -- is the default creator used when saving documents?
position saved boolean -- do documents re-open to their previous position and size?
selection saved boolean -- do documents remember their previous text selection?
auto save boolean -- are documents automatically saved periodically?
auto save delay integer -- minutes between automatic document saves (1-99)
resources preserved boolean -- are non-Tex-Edit file resources preserved during a save?
first sound played boolean -- automatically play document's first sound when opening?
playing boolean [r/o] -- is a sound playing?
speaking boolean [r/o] -- is there an active speaking session?
speech enabled boolean -- is the speech manager on?
text hiliting off/by word/by sentence -- automatic hiliting of text during speech
voice international text -- the speaking voice
rate integer -- rate of speech (1-400)
pitch integer -- pitch of the speech (0-100)
modulation integer -- inflection in the speech (0-100)
text width soft wrap/small/medium/large/page setup size/wide open -- text wrapping width of the window
background color black/red/green/blue/cyan/magenta/yellow/white/marble/gray/sky/ocean/rose/tan/lemon -- the background color of the window (or use RGB color)
Class sound: An embedded sound
Plural form:
sounds
Properties:
<Inheritance> text [r/o] -- all properties of the text class are inherited by this class
Class picture: An embedded picture
Plural form:
pictures
Properties:
<Inheritance> text [r/o] -- all properties of the text class are inherited by this class
Class movie: An embedded quicktime movie
Plural form:
movies
Properties:
<Inheritance> text [r/o] -- all properties of the text class are inherited by this class
Class model: An embedded quickdraw 3D model
Plural form:
models
Properties:
<Inheritance> text [r/o] -- all properties of the text class are inherited by this class